package com.huawei123.hasee.cniao5store.mvp.presenter.impl;

import com.huawei123.hasee.cniao5store.api.IGetDataDelegate;
import com.huawei123.hasee.cniao5store.base.BaseActivity;
import com.huawei123.hasee.cniao5store.base.mvp_base.MvpPresenterImpl;
import com.huawei123.hasee.cniao5store.bean.AppIntroductionBean;
import com.huawei123.hasee.cniao5store.mvp.interactor.AppIntroductionFragmentInteractor;
import com.huawei123.hasee.cniao5store.mvp.presenter.AppIntroductionFramentPresenter;
import com.huawei123.hasee.cniao5store.mvp.view.view.AppIntroductionFragmentView;

import javax.inject.Inject;

/**
 * 项目名称：Cniao5Store
 * 类描述：应用下载详情数据请求
 * 创建人：luohao
 * 创建时间：2018/2/9 18:29
 * 修改人：luohao
 * 修改时间：2018/2/9 18:29
 * 修改备注：
 */

public class AppIntroductionFragmentPresenterImpl extends MvpPresenterImpl<AppIntroductionFragmentView> implements
        AppIntroductionFramentPresenter {
    @Inject
    AppIntroductionFragmentInteractor appIntroductionFragmentInteractor;

    @Inject
    public AppIntroductionFragmentPresenterImpl() {
    }

    @Override
    public void getAppInroductionData(final BaseActivity activity, final String packageName) {
        appIntroductionFragmentInteractor.loadAppIntroduction(activity, packageName, new IGetDataDelegate<AppIntroductionBean>() {
            @Override
            public void getDataSuccess(AppIntroductionBean appIntroductionBean) {
                myPresenterView.onAppIntroductionDataSuccess(appIntroductionBean);
            }

            @Override
            public void getDataError(String errmsg) {
                myPresenterView.onAppIntroductionDataError(errmsg);
            }
        });
    }
}
